/*
	缓冲运动
*/
function bufferMove(obj, target, fn) {
	clearInterval(obj.timer);
	obj.timer = setInterval(function () {
		var bStop = true;
		for(var sAttr in target) {
			var iCur = 0;
			if(sAttr == 'opacity') {
				iCur = Math.round(parseFloat(getStyle(obj, 'opacity'))*100);
			} else {
				iCur = parseInt(getStyle(obj, sAttr));
			}

			var iSpeed = (target[sAttr] - iCur)/8;
			iSpeed = iSpeed > 0 ? Math.ceil(iSpeed) : Math.floor(iSpeed);

			if(sAttr == 'opacity') {
				obj.style.opacity = (iCur + iSpeed)/100;
				obj.style.filter = 'alpha(opacity:' + (iCur + iSpeed) + ')';
			} else {
				obj.style[sAttr] = iCur + iSpeed + 'px';
			}

			if(iCur + iSpeed != target[sAttr]) {
				bStop = false;
			}
		}
		if(bStop) {
			clearInterval(obj.timer);
			fn && fn();
		}
	}, 30);
}
// 获取属性样式
function getStyle(obj, sAttr) {
	if(obj.currentStyle) {
		return obj.currentStyle[sAttr];
	} else {
		return getComputedStyle(obj, false)[sAttr];
	}
}